package com.itheima.common;

public class BaseContext {
    //定义一个ThreadLocal
    private static ThreadLocal<Long> threadLocal=new ThreadLocal<>();
    //获取自己线程存储的值
    public static Long getId(){
        return threadLocal.get();
    }
    public static void setId(Long id){
        threadLocal.set(id);
    }
}
